package com.chencs.app.lianmeng.controller;

import com.alibaba.fastjson.JSON;
import com.chencs.app.lianmeng.service.LMSubjectSer;
import com.chencs.vo.net.lmrequest.LmBannerRequest;
import com.chencs.vo.net.lmrequest.LmSubjectListRequest;
import com.chencs.vo.net.lmrequest.LmSubjectRequest;
import com.chencs.vo.net.lmresponse.LmBannerResponse;
import com.chencs.vo.net.lmresponse.LmSubjectListResponse;
import com.chencs.vo.net.lmresponse.LmSubjectResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/lmSubject")
public class LMSubjectCtr {


    @Autowired
    private LMSubjectSer subjectSer;

    /**
     * 专题列表
     * @param request
     * @return
     */
    @RequestMapping(value = "/getSubject", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String getSubject(@RequestBody LmSubjectRequest request){
        LmSubjectResponse response = subjectSer.getSubject(request);
        return JSON.toJSONString(response);
    }

    /**
     * 专题商品详情
     * @param request
     * @return
     */
    @RequestMapping(value = "/getSubjectItem", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String getSubjectItem(@RequestBody LmSubjectListRequest request){
        LmSubjectListResponse response = subjectSer.getSubjectItem(request);
        return JSON.toJSONString(response);
    }



}
